package com.mofe.zxy.controller;

import com.mofe.zxy.util.SecurityUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder;

/**
 * @ClassName: TestController
 * @Description: TestController
 * @Create by: ZhangXuYuan
 * @Date: 2022/4/13 15:35
 */

@RestController
@RequestMapping("/user")
public class TestController {


    @GetMapping("/getUserName")
    public String getUserName() {
        return "username zxy";
    }

    @GetMapping("/getAdminId")
    public String getAdminId() {
        return "adminId: " + "SecurityUtil.getAdminId()";
    }

    @GetMapping("/getAdminIdFromHeader")
    public String getAdminIdFromHeader() {
        return "adminId: " + SecurityUtil.getAdminIdFromHeader();
    }

    @GetMapping("/test")
    public String test() {
        return "test";
    }
}
